package com.cs.study.homework._0302;

import java.io.FileOutputStream;
import java.io.IOException;

public class Demo4 {
    public static void main(String[] args) throws IOException {
        String[] words = {"verb:eat", "verb:drink", "verb:sleep", "verb:play", "noun:rice", "noun:meat", "noun:hand", "noun:hair"};
        FileOutputStream verb = new FileOutputStream("E:\\a\\verb.txt");
        FileOutputStream noun = new FileOutputStream("E:\\a\\noun.txt");
        for (int i = 0; i < words.length; i++) {
            if (words[i].startsWith("verb")) {
                verb.write(words[i].getBytes());
                verb.write("\r\n".getBytes());
            }else if (words[i].startsWith("noun")) {
                noun.write(words[i].getBytes());
                noun.write("\r\n".getBytes());
            }
        }
    }
}
